package com.yidao.core.domain;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 
 * @author feng
 */
public class SearchExpression {
	
	private String propertyName;
	
	private SearchOperator operator;
	
	private List<Object> values = new ArrayList<Object>();
	
	public SearchExpression(String propertyName){
		this.propertyName = propertyName;
		this.operator = SearchOperator.eq;
	}
	
	public SearchExpression(String propertyName, SearchOperator operator){
		this.propertyName = propertyName;
		this.operator = operator;
	}
	
	public SearchExpression(String propertyName, SearchOperator operator, List<Object> values){
		this.propertyName = propertyName;
		this.operator = operator;
		this.values = values;
	}
	
	public String getPropertyName() {
		return propertyName;
	}

	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}

	public SearchOperator getOperator() {
		return operator;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	public void setOperator(SearchOperator operator) {
		this.operator = operator;
	}

	public List<Object> getValues() {
		return values;
	}

	public void setValues(List<Object> values) {
		this.values = values;
	}
}
